Set resolution factor to 1 when a mask is created #3102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the resolution dimmer slider was used (and not set to 100), and a motion or privacy mask was created/changed, the measurement of the width & height went wrong. Because the number of pixels in the image was less.
Example: When the resolution dimmer slider was set to 80 on a camera with a resolution of 1024x768, it measured 819x614.
The 819x614 was converted to the correct resolution when creating the mask file:
DEBUG: building editable motion mask for camera with id 1 (819x614)
DEBUG: editable mask needs resizing from 819x614 to 1024x768
But this caused the mask to change, probably due to the remainder that is or is not present and due to the resizing itself.
This PR makes sure that the resolutionfactor (controlled by the resolution dimmer slider) is always equal to 1 when creating a mask. I had to add a 1 second delay so that this could be processed before the resolution is measured with 'getCameraFrame'. I hope this approach is acceptable.
Issue: #2755